#!/usr/bin/python
# -*- coding: utf-8 -*-
# @version        : 1.0
# @Create Time    : 2024/9/6 11:11
# @File           : vendor
# @IDE            : PyCharm
# @desc           : 描述

from typing import Optional
from pydantic import BaseModel, ConfigDict, Field
from core.data_types import DatetimeStr


class Param(BaseModel):
    param_type: str = None
    param_name: str = None
    param_value: str = None

    param_detail: Optional[str] = None
    attachment: Optional[str] = None
    remark: Optional[str] = None

    is_active: Optional[bool] = None
    create_user: Optional[str] = None
    update_user: Optional[str] = None


class ParamSimpleOut(Param):
    model_config = ConfigDict(from_attributes=True)

    id: int
    update_datetime: DatetimeStr
    create_datetime: DatetimeStr


class ParamOptionOut(BaseModel):
    model_config = ConfigDict(from_attributes=True)

    param_type: str
    label: str = Field(alias="param_name")
    value: str = Field(alias="param_name")
